import Mock from 'mockjs'

Mock.mock(process.env.VUE_APP_API_BASE_URL + 'paper/author', 'post', (request) => {
    const { author_id } = JSON.parse(request.body)
    switch (author_id){
        case 1:{
            return{
                status: {
                    code: 0,
                    message: "获取作者信息成功"
                  },
                  data: {
                    author:{
                        author_name: "C. Bal\'azs",
                        workList:[
                            {
                                paper_id: 1,
                                title: "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies",
                                authors:[
                                    {
                                        author_id:1,
                                        author_name:"C. Bal\'azs"
                                    },
                                    {
                                        author_id:2,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:3,
                                        author_name:"P. M. Nadolsky"
                                    },
                                    {
                                        author_id:4,
                                        author_name:"C.-P. Yuan"
                                    }
                                ],
                                update_date: "2008-11-26",
                                favorite: false
                            },
                            {
                                paper_id: 2,
                                title: "Absolute electron and positron fluxes from PAMELA/Fermi and Dark Matter",
                                authors:[
                                    {
                                        author_id:1,
                                        author_name:"C. Bal\'azs"
                                    },
                                    {
                                        author_id:5,
                                        author_name:"N. Sahu"
                                    },
                                    {
                                        author_id:6,
                                        author_name:"A. Mazumdar"
                                    }
                                ],
                                update_date: "2009-11-19",
                                favorite: false
                            },
                            {
                                paper_id: 3,
                                title: "Les Houches 2011: Physics at TeV Colliders New Physics Working Group Report",
                                authors:[
                                    {
                                        author_id:7,
                                        author_name:"G. Brooijmans"
                                    },
                                    {
                                        author_id:8,
                                        author_name:"B. Gripaios"
                                    },
                                    {
                                        author_id:1,
                                        author_name:"C. Bal\'azs"
                                    }
                                ],
                                update_date: "2012-04-23",
                                favorite: false
                            },

                        ]
                    },

                  }
            }
        }
        case 2:{
            return{
                status: {
                    code: 0,
                    message: "获取作者信息成功"
                  },
                  data: {
                    author:{
                        author_name: "E. L. Berger",
                        workList:[
                            {
                                paper_id: 1,
                                title: "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies",
                                authors:[
                                    {
                                        author_id:1,
                                        author_name:"C. Bal\'azs"
                                    },
                                    {
                                        author_id:2,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:3,
                                        author_name:"P. M. Nadolsky"
                                    },
                                    {
                                        author_id:4,
                                        author_name:"C.-P. Yuan"
                                    }
                                ],
                                update_date: "2008-11-26",
                                favorite: false
                            },
                            {
                                paper_id: 6,
                                title: "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies",
                                authors:[
                                    {
                                        author_id:15,
                                        author_name:"P. Bartalini"
                                    },
                                    {
                                        author_id:2,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:16,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:17,
                                        author_name:"B. Blok"
                                    }
                                ],
                                update_date: "2011-11-08",
                                favorite: false
                            },
                            {
                                paper_id: 7,
                                title: "Lepton Pair Production at the LHC and the Gluon Density in the Proton",
                                authors:[
                                    {
                                        author_id:2,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:18,
                                        author_name:"M. Klasen "
                                    }
                                ],
                                update_date: "2007-05-23",
                                favorite: false
                            }
                        ]
                    },

                  }
            }
        }
        case 3:{
            return{
                status: {
                    code: 0,
                    message: "获取推荐成功"
                  },
                  data: {
                    author:{
                        author_name: "P. M. Nadolsky",
                        workList:[
                            {
                                paper_id: 1,
                                title: "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies",
                                authors:[
                                    {
                                        author_id:1,
                                        author_name:"C. Bal\'azs"
                                    },
                                    {
                                        author_id:2,
                                        author_name:"E. L. Berger"
                                    },
                                    {
                                        author_id:3,
                                        author_name:"P. M. Nadolsky"
                                    },
                                    {
                                        author_id:4,
                                        author_name:"C.-P. Yuan"
                                    }
                                ],
                                update_date: "2008-11-26",
                                favorite: false
                            },
                            {
                                paper_id: 8,
                                title: "Implications of CTEQ global analysis for collider observables",
                                authors:[
                                    {
                                        author_id:3,
                                        author_name:"P. M. Nadolsky"
                                    },
                                    {
                                        author_id:19,
                                        author_name:"H.-L. Lai"
                                    },
                                    {
                                        author_id:20,
                                        author_name:"Q.-H. Cao"
                                    },
                                    {
                                        author_id:21,
                                        author_name:"J. Huston"
                                    }
                                ],
                                update_date: "2008-11-26",
                                favorite: false
                            },
                            {
                                paper_id: 9,
                                title: "Progress in CTEQ/TEA global QCD analysis",
                                authors:[
                                    {
                                        author_id:3,
                                        author_name:"P. M. Nadolsky"
                                    },
                                    {
                                        author_id:20,
                                        author_name:"J. Huston"
                                    },
                                    {
                                        author_id:19,
                                        author_name:"H.-L. Lai"
                                    },
                                    {
                                        author_id:4,
                                        author_name:"C.-P. Yuan"
                                    }
                                ],
                                update_date: "2009-09-29",
                                favorite: false
                            }
                        ]
                    },

                  }
            }
        }
        case 4:{
            return{
                status: {
                    code: 0,
                    message: "获取推荐成功"
                  },
                  data: {
                    author:{
                        author_name: "C.-P. Yuan",
                        workList:[
                            {
                                paper_id: 1,
                                title: "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies",
                                authors:[
                                {
                                    author_id:1,
                                    author_name:"C. Bal\'azs"
                                },
                                {
                                    author_id:2,
                                    author_name:"E. L. Berger"
                                },
                                {
                                    author_id:3,
                                    author_name:"P. M. Nadolsky"
                                },
                                {
                                    author_id:4,
                                    author_name:"C.-P. Yuan"
                                }
                                ],
                                update_date: "2008-11-26",
                                favorite: false
                            }
                        ]
                    },

                  }
            }
        }
    }
})